#! /usr/bin/env python
import os, sys, cgi, re, time, shutil, traceback, getopt, locale
import tarfile
import subprocess

try:
    #165,210,224,237,256,269,282,295,308,321,339,352,365,379,392,406,419,432,445,458,471,484,505,520,533,546,559,573,587,601,616,630,644,660,683,707,744,173,211,225,238,257,270,283,296,309,322,340,353,366,380,393,407,420,433,446,459,472,485
    #506,521,534,547,560,574,588,603,617,631,645,663,685,709,745,175,213,226,239,258,271,284,297,310,323,341,354,367,381,394,408,421,434,447,460,473,486,508,522,535,548,561,575,589,605,618,632,646,666,686,711,755,176,214,227,240,259,272,285,298,311,324,342,355,368,382,395,409,422,435,448,461,474,487,509,523,536,549,562,576,590,606,619,633,647,669,688,712,762,182,215,228,241,260,273,286,299,312,325,343,356,369,383,396,410,423,436,449,462,475,489,510,524,537,550,563,577,591,607,620,634,648,670,690,714,765,183,216,229,242,261,274,287,300,313,326,344,357
    #370,384,397,411,424,437,450,463,476,490,512,525,538,551,564,578,592,608,621,635,649,672,692,715,785,185,217,230,243,262,275,288,301,314,327,
    #345,358,371,385,398,412,425,438,451,464,477,491,513,526,539,552,565,579,593,609,622,636,651,675,693,721,795,188,218,231,245,263,276,289,302,315,329,346,359,372,386,400,413,426,439,452,465,478,492,514,527,540,553,566,580,594,610,623,637,652,676,696,723,850,194,219,232,247,264,277,290,303,316,330,347,360,373,387,401,414,427,440,453,466,479,493,515,528,541,554,567,581,595,611,625,638,653,677,700,724,86,196,220,233,250,265,278,291,304,317,333,348,361,375,
    #388,402,415,428,441,454,467,480,494,516,529,542,555,568,582,596,612,626,639,654,678,701,725,860,201,221,234,252,266,279,292,305,318,336,349,362,376,389,403,416,429,442,455,468,481,
    list = [495,517,530,543,556,570,583,597,613,627,641,656,680,703,727,890,205,222,235,254,267,280,293,306,319,337,350,363,377,390,404,417,430,443,456,469,482,500,518,531,544,557,571,584,598,614,628,642,657,681,704,731,207,223,236,255,268,281,294,307,320,338,351,364,378,391,405,418,431,444,457,470,483,504,519,532,545,558,572,585,600,615,629,643,659,682,705,736]
    for dir in list:
        cmd = "rsync -auvH 88.191.79.179::data/%s /home/doc4/data" % dir
        print cmd
        proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
        output = proc.communicate()
        print output
        proc.wait()
            
    sys.exit(0)
except Exception,e:
        traceback.print_exc(file=sys.stdout)
        sys.exit(1)
                
